//
//  TaskWithLogin.m
//  DuBai
//
//  Created by darktm on 14-2-23.
//  Copyright (c) 2014年 darktm. All rights reserved.
//

#import "TaskWithLogin.h"

#import "LoginObject.h"

@implementation TaskWithLogin


-(instancetype)initWithName:(NSString *)username withPwd:(NSString *)pwd{

    self = [super init];
    
    self.username = username;
    self.pwd = pwd;  
    
    return self;
}

-(void)prepare{
    
    NSMutableDictionary *mDic = [NSMutableDictionary dictionaryWithCapacity:3];
    [mDic setValue:self.username forKey:@"username"];
    [mDic setValue:self.pwd forKey:@"password"];
    
    [self startAsyncWithParams:mDic withMethod:@"POST" withURL:[Configure userLogin]];
}

-(id)parese{
    
    if([self.rcvData isKindOfClass:[NSDictionary class]]){
        LoginObject *obj = [[LoginObject alloc] initWithReflectData:self.rcvData];
        
#warning 能够直接根据路径修改字符串
//        DLog(@"%@",[obj valueForKeyPath:@"statu.capitalizedString"]);
    }
    
    return self.rcvData;
}

@end
